﻿using iMES.Entity.SystemModels;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace iMES.Entity.DomainModels
{

    [Entity(TableCnName = "生产订单", DetailTable = new Type[] { typeof(OrderProductList) }, TableName = "ProductionOrderInfo", DetailTableCnName = "订单产品明细", DBServer = "SysDbContext")]
    public partial class ProductionOrderInfo : SysEntity
    {
        /// <summary>
        ///生产订单主键
        /// </summary>
        [Key]
        [Display(Name = "生产订单主键")]
        [Column(TypeName = "uniqueidentifier")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public Guid ProductionOrderId { get; set; }

        /// <summary>
        ///生产编号
        /// </summary>
        [Display(Name = "生产编号")]
        [MaxLength(100)]
        [Column(TypeName = "varchar(100)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string ProductionOrderCode { get; set; }

        /// <summary>
        ///字典主键 类型为客户
        /// </summary>
        [Display(Name = "客户表主键")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int DCustomerId { get; set; }
        /// <summary>
        ///字典 生产状态
        /// </summary>
        [Display(Name = "生产状态")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int ProductStatus { get; set; }
        /// <summary>
        ///订单编号
        /// </summary>
        [Display(Name = "订单编号")]
        [MaxLength(100)]
        [Column(TypeName = "varchar(100)")]
        [Editable(true)]
        public string OrderCode { get; set; }
        /// <summary>
        ///创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        ///优先级
        /// </summary>
        [Display(Name = "优先级")]
        [Editable(true)]
        [Column(TypeName = "int")]
        [Required(AllowEmptyStrings = false)]
        public int Priority { get; set; }
        /// <summary>
        ///订单来源
        /// </summary>
        [Display(Name = "订单来源")]
        [MaxLength(100)]
        [Column(TypeName = "varchar(100)")]
        [Editable(true)]
        public string OrderSource { get; set; }
        /// <summary>
        ///备注
        /// </summary>
        [Display(Name = "备注")]
        [MaxLength(200)]
        [Column(TypeName = "varchar(200)")]
        [Editable(true)]
        public string Remarks { get; set; }

        /// <summary>
        ///生产订单成品
        /// </summary>
        [Display(Name = "生产订单成品")]
        [MaxLength(200)]
        [Column(TypeName = "varchar(200)")]
        [Editable(true)]
        public string ProductList { get; set; }

        [Display(Name = "订单成品")]
        [ForeignKey("ProductionOrderId")]
        public List<OrderProductList> OrderProductList { get; set; }
    }
}
